<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>CAD-Tool: /home/manish/Desktop/Manish_CAD_Tool/src/general_methods.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">CAD-Tool
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">general_methods.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="general__methods_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="general__methods_8h.html">include/general_methods.h</a>&quot;</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;</div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="keyword">using namespace </span><a class="code" href="namespacestd.html">std</a>;</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;</div><div class="line"><a name="l00005"></a><span class="lineno"><a class="line" href="general__methods_8cpp.html#a2dc9a47107e3f17fb944f6077f942236">    5</a></span>&#160;<a class="code" href="classvertex__3d.html">vertex_3d</a> <a class="code" href="general__methods_8cpp.html#a2dc9a47107e3f17fb944f6077f942236">cross_product</a>(<a class="code" href="classvertex__3d.html">vertex_3d</a> a, <a class="code" href="classvertex__3d.html">vertex_3d</a> b)</div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;{</div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;    <span class="keywordtype">float</span> x,y,z;</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;    x = a.<a class="code" href="classvertex__3d.html#a44d8a3570860630dc76bfa0817786a9b">y</a> * b.<a class="code" href="classvertex__3d.html#a9028d1e6317552f63d6cbd57ff5a42ba">z</a> - a.<a class="code" href="classvertex__3d.html#a9028d1e6317552f63d6cbd57ff5a42ba">z</a> * b.<a class="code" href="classvertex__3d.html#a44d8a3570860630dc76bfa0817786a9b">y</a>;</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;    y = b.<a class="code" href="classvertex__3d.html#a3f42c81ecbe6cab86cda63854c7799c8">x</a> * a.<a class="code" href="classvertex__3d.html#a9028d1e6317552f63d6cbd57ff5a42ba">z</a> - a.<a class="code" href="classvertex__3d.html#a3f42c81ecbe6cab86cda63854c7799c8">x</a> * b.<a class="code" href="classvertex__3d.html#a9028d1e6317552f63d6cbd57ff5a42ba">z</a>;</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;    z = a.<a class="code" href="classvertex__3d.html#a3f42c81ecbe6cab86cda63854c7799c8">x</a> * b.<a class="code" href="classvertex__3d.html#a44d8a3570860630dc76bfa0817786a9b">y</a> - a.<a class="code" href="classvertex__3d.html#a44d8a3570860630dc76bfa0817786a9b">y</a> * b.<a class="code" href="classvertex__3d.html#a3f42c81ecbe6cab86cda63854c7799c8">x</a>;</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;</div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;    <a class="code" href="classvertex__3d.html">vertex_3d</a> ans(x,y,z);</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;    <span class="keywordflow">return</span> ans;</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;}</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="general__methods_8cpp.html#adde63ba9542357791cc6a967f2ea582e">   17</a></span>&#160;<span class="keywordtype">float</span> <a class="code" href="general__methods_8cpp.html#adde63ba9542357791cc6a967f2ea582e">dot_product</a>(<a class="code" href="classvertex__3d.html">vertex_3d</a> a, <a class="code" href="classvertex__3d.html">vertex_3d</a> b)</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;{</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;    <span class="keywordtype">float</span> ans;</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;    ans = a.<a class="code" href="classvertex__3d.html#a3f42c81ecbe6cab86cda63854c7799c8">x</a>*b.<a class="code" href="classvertex__3d.html#a3f42c81ecbe6cab86cda63854c7799c8">x</a> + a.<a class="code" href="classvertex__3d.html#a44d8a3570860630dc76bfa0817786a9b">y</a>*b.<a class="code" href="classvertex__3d.html#a44d8a3570860630dc76bfa0817786a9b">y</a> + a.<a class="code" href="classvertex__3d.html#a9028d1e6317552f63d6cbd57ff5a42ba">z</a>*b.<a class="code" href="classvertex__3d.html#a9028d1e6317552f63d6cbd57ff5a42ba">z</a>;</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;    <span class="keywordflow">return</span> ans;</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;}</div><div class="ttc" id="general__methods_8cpp_html_adde63ba9542357791cc6a967f2ea582e"><div class="ttname"><a href="general__methods_8cpp.html#adde63ba9542357791cc6a967f2ea582e">dot_product</a></div><div class="ttdeci">float dot_product(vertex_3d a, vertex_3d b)</div><div class="ttdef"><b>Definition:</b> <a href="general__methods_8cpp_source.html#l00017">general_methods.cpp:17</a></div></div>
<div class="ttc" id="classvertex__3d_html"><div class="ttname"><a href="classvertex__3d.html">vertex_3d</a></div><div class="ttdoc">class for a vertex_3d </div><div class="ttdef"><b>Definition:</b> <a href="structs_8h_source.html#l00064">structs.h:64</a></div></div>
<div class="ttc" id="classvertex__3d_html_a44d8a3570860630dc76bfa0817786a9b"><div class="ttname"><a href="classvertex__3d.html#a44d8a3570860630dc76bfa0817786a9b">vertex_3d::y</a></div><div class="ttdeci">float y</div><div class="ttdoc">y-coordinate of the vertex </div><div class="ttdef"><b>Definition:</b> <a href="structs_8h_source.html#l00067">structs.h:67</a></div></div>
<div class="ttc" id="namespacestd_html"><div class="ttname"><a href="namespacestd.html">std</a></div></div>
<div class="ttc" id="classvertex__3d_html_a9028d1e6317552f63d6cbd57ff5a42ba"><div class="ttname"><a href="classvertex__3d.html#a9028d1e6317552f63d6cbd57ff5a42ba">vertex_3d::z</a></div><div class="ttdeci">float z</div><div class="ttdoc">z-coordinate of the vertex </div><div class="ttdef"><b>Definition:</b> <a href="structs_8h_source.html#l00068">structs.h:68</a></div></div>
<div class="ttc" id="classvertex__3d_html_a3f42c81ecbe6cab86cda63854c7799c8"><div class="ttname"><a href="classvertex__3d.html#a3f42c81ecbe6cab86cda63854c7799c8">vertex_3d::x</a></div><div class="ttdeci">float x</div><div class="ttdoc">x-coordinate of the vertex </div><div class="ttdef"><b>Definition:</b> <a href="structs_8h_source.html#l00066">structs.h:66</a></div></div>
<div class="ttc" id="general__methods_8cpp_html_a2dc9a47107e3f17fb944f6077f942236"><div class="ttname"><a href="general__methods_8cpp.html#a2dc9a47107e3f17fb944f6077f942236">cross_product</a></div><div class="ttdeci">vertex_3d cross_product(vertex_3d a, vertex_3d b)</div><div class="ttdef"><b>Definition:</b> <a href="general__methods_8cpp_source.html#l00005">general_methods.cpp:5</a></div></div>
<div class="ttc" id="general__methods_8h_html"><div class="ttname"><a href="general__methods_8h.html">general_methods.h</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
